/*
 * @Author: guandeshen 295570679@qq.com
 * @Date: 2024-05-19 12:24:05
 * @LastEditors: guandeshen 295570679@qq.com
 * @LastEditTime: 2024-09-18 16:17:22
 * @FilePath: /task-admin/src/api/task/model.ts
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
/**
 * 任务列表
 */
interface WBS {
  id: number | string;
  project_id?: number | string;
  wbs_name?: string;
}
export interface TaskList {
  id: number | string;
  wbs_id?: number | string;
  task_name?: string;
  start_d?: string;
  end_d?: string;
  status?: number;
  wbs?: WBS;
  project_name: string;
}

/**
 * 用户查询对象类型
 */
export interface TaskQuery extends PageQuery {
  project_id?: number | string;
  site_id?: number | string;
}

/**
 * 任务表单对象类型
 */
interface Assets {
  asset_id: number | string;
  qty: number;
  start_d: string;
  end_d: string;
  return_stock: number;
}

export interface InchargeObj {
  id?: number | string;
  nickname?: string;
  mobile?: string;
  url?: string;
}

export interface TaskInfo {
  id?: number | string;
  project_id?: number | string;
  wbs_id?: number | string;
  site_id?: number | string;
  task_name?: string;
  task_description?: string;
  blk_number?: string;
  floor_level?: string;
  unit_number?: string;
  start_d?: string;
  end_d?: string;
  is_milestone?: number; //1=是，0=否
  early_start_dependency?: string;
  person_incharge_phone?: string;
  stakeholder_id?: string[];
  person_incharge?: string;
  stakeholder_id_arr?: string[];
  risks?: string;
  status?: number;
  schedule?: number;
}
export interface SaleGoods {
  id?: string;
  ref?: string;
  asset_id?: string;
  asset_type?: string;
  asset_name?: string;
  unit_price?: string;
  total_price?: number;
  unit?: string;
  num?: number;
  stock?: number;
  supplier_name?: string;
  created?: string;
  days?: number;
  create_time?: string;
}

export interface SiteInfo {
  id?: number | string;
  s_name?: string;
}

export interface LeaseGoods {
  id?: string;
  ref?: string;
  asset_id?: string;
  asset_type?: string;
  asset_name?: string;
  unit_price?: string;
  total_price?: number;
  unit?: string;
  num?: number;
  stock?: number;
  supplier_name?: string;
  created?: string;
  days?: number;
  create_time?: string;
}

export interface TaskUsers {
  id?: string;
  ref?: string;
  daily_wage?: string;
  user_ref?: string;
  nickname?: string;
  type_of_work?: string;
  created?: string;
  gender?: number;
  days?: number;
  mobile?: string;
  group_name?: string;
}

export interface PlansDetail {
  id?: number | string;
  work_title?: string;
  task_description?: string;
  work_date?: string;
}

export interface PlansLogs {
  id?: number | string;
  log_time?: string;
  log_remark?: string;
  employee_id?: number | string;
  log_photo?: string[];
  employee_name?: string;
}

export interface PlansList {
  detail?: PlansDetail;
  logs?: PlansLogs[];
}
export interface TaskPlans {
  day?: string;
  list?: PlansList[];
}
export interface LossList {
  id?: number | string;
  ref?: string;
  date_h?: string;
  amount?: number;
  remark?: string;
}

export interface LossInfo {
  loss_amount?: number;
  loss_list?: LossList[];
}

export interface ProjectInfo {
  id?: number | string;
  ref?: number | string;
  p_name?: string;
  p_no?: string;
  status?: number;
  p_manager?: string;
  status_text?: string;
}

export interface WbsInfo {
  id?: number | string;
  ref?: number | string;
  wbs_name?: string;
  end_d?: string;
  is_milestone?: number;
  status?: number;
}

export interface TaskForm {
  task_info?: TaskInfo;
  sale_goods?: SaleGoods[];
  lease_goods?: LeaseGoods[];
  task_users?: TaskUsers[];
  loss_info?: LossInfo;
  loss_list?: LossList[];
  system_info?: SystemForm;
  project_info?: ProjectInfo;
  wbs_info?: WbsInfo;
  site_info?: SiteInfo;
  task_plans?: TaskPlans[];
}

/**
 * 组长查询对象类型
 */
export interface GroupleaderQuery extends PageQuery {
  keyword?: string;
}
/**
 * 组长列表
 */
export interface GroupleaderList {
  id: number | string;
  group_id: number | string;
  nickname: string;
  url: string;
}

/**
 * WBS查询对象类型
 */
export interface WBSQuery extends PageQuery {
  keyword?: string;
  site_id?: number | string;
  project_id: number | string;
  status?: number;
}

/**
 * WBS列表对象类型
 */
export interface WBSList {
  id: number | string;
  wbs_name: string;
}

/**
 * Task Info 查询对象类型
 */
export interface TaskInfoQuery {
  task_id: number | string;
}

/**
 * 资产查询对象类型
 */
export interface AssetsQuery extends PageQuery {
  keyword?: string;
}

/**
 * 资产列表对象类型
 */
export interface AssetsList {
  id: number | string;
  ref: string;
  asset_name: string;
  asset_qty: number;
  asset_unit: string;
}

/**
 * 联系人查询对象类型
 */
export interface StakeholderQuery extends PageQuery {
  keyword?: string;
}

/**
 * 联系人列表对象类型
 */
export interface StakeholderList {
  id: number;
  ref: string;
  first_n: string;
  last_n: string;
}

export interface detailQuery {
  task_id: string;
}
